/**
 * C Programming: A Modern Approach
 *
 * version: 2nd
 * author: K.N.King
 * http://knking.com/books/c2
 */

#include <stdio.h>

/**
 * Prints int and float values in various formats
 */

int main(void) {
    int i = 40;
    float x = 839.21f;

    printf("|%d|%5d|%-5d|%5.3d|\n", i, i, i, i);
    printf("|%10.3f|%10.3e|%-10g|\n", x, x, x);

    return 0;
}

/*
output:
|40|   40|40   |  040|
|   839.210| 8.392e+02|839.21    |
*/